<template>
    <!-- 添加或修改定时任务对话框 -->
    <a-modal :title="title" v-model="open" width="820px" append-to-body>
        <a-form ref="jobRef" :model="form" :rules="rules" laba-width="120px">
            <a-row>
                <a-col :span="12">
                    <a-form-item label="任务名称" prop="jobName">
                        <a-input v-model="form.jobName" placeholder="请输入任务名称" />
                    </a-form-item>
                </a-col>
                <a-col :span="12">
                    <a-form-item label="任务分组" prop="jobGroup">
                        <a-select v-model="form.jobGroup" placeholder="请选择">
                            <a-option v-for="dict in sys_job_group" :key="dict.value" :label="dict.label"
                                :value="dict.value"></a-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :span="24">
                    <a-form-item prop="invokeTarget">
                        <template #label>
                            <span>
                                调用方法
                                <a-tooltip placement="top">
                                    <template #content>
                                        <div>
                                            Bean调用示例：ryTask.ryParams('ry')
                                            <br />Class类调用示例：com.ruoyi.quartz.task.RyTask.ryParams('ry')
                                            <br />参数说明：支持字符串，布尔类型，长整型，浮点型，整型
                                        </div>
                                    </template>
                                    <a-icon><question-filled /></a-icon>
                                </a-tooltip>
                            </span>
                        </template>
                        <a-input v-model="form.invokeTarget" placeholder="请输入调用目标字符串" />
                    </a-form-item>
                </a-col>
                <a-col :span="24">
                    <a-form-item label="cron表达式" prop="cronExpression">
                        <a-input v-model="form.cronExpression" placeholder="请输入cron执行表达式">
                            <template #append>
                                <a-button type="primary" @click="handleShowCron">
                                    生成表达式
                                    <i class="a-icon-time a-icon--right"></i>
                                </a-button>
                            </template>
                        </a-input>
                    </a-form-item>
                </a-col>
                <a-col :span="24" v-if="form.jobId !== undefined">
                    <a-form-item label="状态">
                        <a-radio-group v-model="form.status">
                            <a-radio v-for="dict in sys_job_status" :key="dict.value" :label="dict.value">{{ dict.label
                                }}</a-radio>
                        </a-radio-group>
                    </a-form-item>
                </a-col>
                <a-col :span="12">
                    <a-form-item label="执行策略" prop="misfirePolicy">
                        <a-radio-group v-model="form.misfirePolicy">
                            <a-radio-button label="1">立即执行</a-radio-button>
                            <a-radio-button label="2">执行一次</a-radio-button>
                            <a-radio-button label="3">放弃执行</a-radio-button>
                        </a-radio-group>
                    </a-form-item>
                </a-col>
                <a-col :span="12">
                    <a-form-item label="是否并发" prop="concurrent">
                        <a-radio-group v-model="form.concurrent">
                            <a-radio-button label="0">允许</a-radio-button>
                            <a-radio-button label="1">禁止</a-radio-button>
                        </a-radio-group>
                    </a-form-item>
                </a-col>
            </a-row>
        </a-form>
    </a-modal>
</template>

<script setup name="JobForm">

</script>